package thread;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/5/2
 * Time:12:30
 **/
//有三个线程，线程名称分别为：a，b，c。
//每个线程打印自己的名称。
//需要让他们同时启动，并按 c，b，a的顺序打印
public class ThreadDemo24 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("a");

            }
        });
        t1.start();

        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("b");
            }
        });
        t2.start();

        Thread t3 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("c");
            }
        });
        t3.start();

    }
}
